<?php
/**
 * (commands) 亚马逊物流管理库存
 */
namespace App\Console\Commands\SpApi\Report\CreateAndGet;

use App\Crontab\Daily\SpApi\GrabCreateReport;
use Illuminate\Console\Command;
class MYIInventory extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'sp-report:myi-inventory {accountId=0}';

    /**
     * The console command description.
     * @var string
     */
    protected $description = 'exe func';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     */
    public function handle()
    {
        $where = [];
        $multi = true;
        $accountId = $this->argument('accountId');
        if($accountId){
            $where['id'] = $accountId;
        }

        $data = [
            'report_type' => 'GET_FBA_MYI_UNSUPPRESSED_INVENTORY_DATA'
        ];

        GrabCreateReport::grab($data,$where,$multi);
        $this->info('finish!');
    }
}
